#pragma once

#include <QObject>
#include <QString>
#include <QDebug>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/unistd.h>
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>

class ProcessLinuxWrap : public QObject
{
Q_OBJECT
// Interface =======================================
public:
    enum class ErrCode{
        ErrOK,
        ErrUnknownError,
        ErrOrderImplementFail,
        ErrSpecifyNameOfProcessNoRun,
        ErrCreateProcessFail,
        ErrKillProcessFail,
    };
    Q_ENUM(ErrCode)

    explicit ProcessLinuxWrap(QObject *parent = nullptr);
    bool     getSpecifyProcessIsRun(QString ProcessName);
    ErrCode  getPid(QString ProcessName, pid_t* opPid);
    ErrCode  createDetachedPid(QString AppPath);
    ErrCode  killPid(pid_t Pid);

//
public:

signals:

public slots:

};
